import request from "@/utils/request";

// 查看收藏
export const cartListAPI = (params) => {
    return request.get('/order/queryAll', { params })
}

// 加入收藏
// 注意：data需要是一个formData格式的对象
export const cartPublishService = (dishId) => {
    const params = new URLSearchParams();
    params.append('dishId', dishId);
    return request.post('/order/addCart', params)
}

// 从收藏中移除
export const cartDelService = (id) =>
    request.delete('/order/deleteCart/' + id)